:root {
    --gold-color: #FFD700;
    --wood-color: #8B4513;
    --water-color: #1E90FF;
    --fire-color: #FF4500;
    --earth-color: #8B4513;
}

body {
    margin: 0;
    padding: 20px;
    font-family: 'Microsoft YaHei', sans-serif;
    background-color: #f0f0f0;
}

#game-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.player-area {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 10px;
}

.card-zones {
    display: flex;
    gap: 20px;
    margin: 10px 0;
}

.player-info {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background-color: #eee;
    border-radius: 5px;
}

.deck, .graveyard {
    width: 70px;
    height: 100px;
    background-color: #ddd;
    border: 2px solid #999;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.monster-zone, .magic-zone {
    flex: 1;
    min-height: 120px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    display: flex;
    gap: 10px;
    padding: 10px;
}

.hand {
    display: flex;
    gap: 10px;
    min-height: 120px;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 5px;
    padding: 10px;
}

.card {
    width: 70px;
    height: 100px;
    border: 1px solid #000;
    border-radius: 5px;
    padding: 5px;
    cursor: pointer;
    position: relative;
    background-color: white;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    border-width: 2px;
}

.card.monster {
    background-color: #f8f8f8;
}

.card.magic {
    background-color: #e6e6fa;
}

.card-name {
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 12px;
    text-align: center;
}

.card-stats {
    font-size: 11px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.card-effect {
    font-size: 11px;
    text-align: center;
    margin-top: 10px;
    color: #666;
}

.card-info {
    display: none;
    position: absolute;
    background: rgba(255,255,255,0.95);
    border-radius: 3px;
    padding: 5px;
    width: 150px;
    left: 100%;
    top: 0;
    z-index: 1000;
}

.card:hover .card-info {
    display: block;
}

.battle-log {
    height: 150px;
    overflow-y: auto;
    background-color: white;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 10px;
}

.game-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.control-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    background-color: #4CAF50;
    color: white;
    cursor: pointer;
}

.control-btn:hover {
    background-color: #45a049;
}

.dialog {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.attribute-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.attribute-buttons button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.attribute-buttons button[data-attribute="金"] { background-color: var(--gold-color); }
.attribute-buttons button[data-attribute="木"] { background-color: var(--wood-color); color: white; }
.attribute-buttons button[data-attribute="水"] { background-color: var(--water-color); color: white; }
.attribute-buttons button[data-attribute="火"] { background-color: var(--fire-color); color: white; }
.attribute-buttons button[data-attribute="土"] { background-color: var(--earth-color); color: white; }

.card.selected {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.card.attackable {
    cursor: pointer;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255,69,0,0.4); }
    70% { box-shadow: 0 0 0 10px rgba(255,69,0,0); }
    100% { box-shadow: 0 0 0 0 rgba(255,69,0,0); }
}

.card[data-position="defense"] {
    background-color: #e8e8e8;
    transform: rotate(90deg);
}

.card-back {
    width: 100%;
    height: 100%;
    background-color: #2196F3;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.game-result {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px 40px;
    border-radius: 10px;
    font-size: 24px;
    animation: fadeIn 0.5s ease;
}

.control-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.card[data-position="defense"] .card-stats,
.card[data-position="defense"] .card-name {
    transform: rotate(-90deg);
}

.battle-log {
    font-size: 14px;
    line-height: 1.5;
}

.battle-log div {
    padding: 2px 5px;
    border-bottom: 1px solid #eee;
}

.battle-log div:last-child {
    border-bottom: none;
    color: #4CAF50;
    font-weight: bold;
}

.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-text {
    color: white;
    font-size: 24px;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

/* 消息提示样式 */
.message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    border-radius: 5px;
    z-index: 1000;
    animation: fadeInOut 3s ease;
}

.message.info {
    background-color: #4CAF50;
    color: white;
}

.message.error {
    background-color: #f44336;
    color: white;
}

/* 直接攻击按钮样式 */
.direct-attack-btn {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    background-color: #ff4444;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.direct-attack-btn:hover {
    background-color: #cc0000;
}

/* 区域背景样式 */
[id$='monster-zone'] {
    background: rgba(255, 235, 205, 0.2);
    border: 2px solid rgba(139, 69, 19, 0.3);
    border-radius: 8px;
    padding: 10px;
    position: relative;
}

[id$='magic-zone'] {
    background: rgba(176, 224, 230, 0.2);
    border: 2px solid rgba(70, 130, 180, 0.3);
    border-radius: 8px;
    padding: 10px;
    position: relative;
}

/* 区域标题样式 */
[id$='monster-zone']::before {
    content: '怪兽区域';
    position: absolute;
    top: -20px;
    left: 10px;
    background: #fff;
    padding: 0 10px;
    font-size: 12px;
    color: #8B4513;
}

[id$='magic-zone']::before {
    content: '魔法区域';
    position: absolute;
    top: -20px;
    left: 10px;
    background: #fff;
    padding: 0 10px;
    font-size: 12px;
    color: #4682B4;
}

/* 动画效果 */
@keyframes fadeInOut {
    0% { opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { opacity: 0; }
}

/* 添加自定义对话框样式 */
.position-dialog {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
    z-index: 1000;
}

.position-dialog h3 {
    margin: 0 0 15px 0;
    color: #333;
    text-align: center;
}

.position-dialog .buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.position-dialog button {
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.position-dialog button.attack {
    background-color: #ff4444;
    color: white;
}

.position-dialog button.defense {
    background-color: #4444ff;
    color: white;
}

.position-dialog button.cancel {
    background-color: #666;
    color: white;
}

.position-dialog button:hover {
    opacity: 0.9;
} 